<?php
declare (strict_types=1);

namespace app\controller\admin;

use app\common\controller\BaseController;
use app\model\admin\Order as orderModel;
use think\App;
use \Throwable;

class Order extends BaseController
{
    protected $model;

    public function __construct(App $app, orderModel $model)
    {
        parent::__construct($app);
        $this->model = $model;
    }

    /**
     * 列表查询
     * @return array
     */
    public function query()
    {
        $where = [];
        $where[] = ['pay_status', '=', 1];
        $where[] = ['order_type', 'in', [1,2]];
        $page = input('page/d', 1);
        $pageSize = input('page_size/d', 20);
        $order = null;
        $fields = 'id,order_no,member_id,member_id member,store_id,store_id store_name,re_id,book_id book_time,book_id game_title,pay_price,order_type,order_type order_type_text,pay_price';
        return $this->model->getList($where, $fields, $order, $page, $pageSize);
    }
}
